 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="/js/common_basic.js"></script>
    <script type="text/javascript">
    	$(document).ready(function() {
		});

		function removeArtist(idx) {
			if (confirm('삭제?')) {
				document.frm2.idx.value = idx;
				document.frm2.submit();
			}
		}

		// 페이지 이동
		function goPage(page) {
			$("#page").val(page);
			$("#frm").submit();
		}
    </script>
	
</head>
<body>
<form method="post" name="frm2" id="frm2" action="/star/starpt/remove_ok">
	<input type="hidden" name="idx" />
	<input type="hidden" name="page" value="<?=!empty($_GET['page']) ? $_GET['page'] : '1'?>" />
</form>
<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/header.php'; ?>
	<!--// Header -->

    <!--컨텐츠-->
	<div id="content">
		<h2>사진으로 보는 운세</h2>
		<div>
			<input type="button" value="등록" onclick="location.href='/star/starpt/write'" />
			<input type="button" value="전체 리스트" onclick="location.href='/star/starpt'" />
		</div>
		<div class="seach">
			<form id="frm" method="get" action="/star/starpt">
				<input type="hidden" name="page" id="page" value="<?=!empty($_GET['page']) ? $_GET['page'] : '1'?>" />
				<fieldset>
					<select name="search_type" id="search" title="검색어 분류선택" class="input_select">
						<option value="subject">제목</option>
						<option value="content">내용</option>
						<option value="nickname">작성자</option>
					</select>
					<input type="text" name="search_keyword" id="search_keyword" maxlength="30" title="검색어 입력" class="inpText" />
					<input type="submit" value="검색" align="top" />
				</fieldset>
			</form>
		</div>
		<div>
			<table class="basicTable" width="100%" cellpadding="2" cellspacing="1" border="0">
				<thead>
					<tr>
						<th scope="col">번호</th>
						<th scope="col">제목</th>
						<th scope="col">작성자</th>
						<th scope="col">공감</th>
						<th scope="col">조회수</th>
						<th scope="col">작성일</th>
						<th scope="col">삭제</th>
					</tr>
				</thead>
				<tbody>
				<?	foreach ($list as $item) :?>
					<tr>
						<td align="center"><?=$item['idx']?></td>
						<td align="left"><a href="http://www.unsin.co.kr/bbs/starpt/read?idx=<?=$item['idx']?>" target="_blank"><?=$item['subject']?></a></td>
						<td align="center"><?=$item['nickname']?></td>
						<td align="center"><?=$item['recommend']?></td>
						<td align="center"><?=$item['hit']?></td>
						<td align="center"><?=substr($item['create_dt'], 0,10)?></td>
						<td align="center"><button onclick="removeArtist('<?=$item['idx']?>')">삭제</button></td>
					</tr>
				<?	endforeach ?>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="7">
							<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/board/page_navi.php'; ?>
						</td>
					</tr>
				</tfoot>
			</table>
		</div>
		<!--//게시판--> 
	</div>
	<!--리스트--> 

	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/footer.php'; ?>
	<!--// Footer -->
</div>
</body>
</html>